﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:k="http://schemas.microsoft.com/kinect/2013"
        xmlns:local="clr-namespace:KinectBingMap"
        xmlns:kt="clr-namespace:Microsoft.Samples.Kinect.WpfViewers;assembly=Microsoft.Samples.Kinect.WpfViewers"
        xmlns:ViewModels="clr-namespace:KinectBingMap.ViewModels" x:Class="KinectBingMap.MainWindow"      
        xmlns:m="clr-namespace:Microsoft.Maps.MapControl.WPF;assembly=Microsoft.Maps.MapControl.WPF"
        Title="Kinect Map"
        Loaded="Window_Loaded"
        Closing="WindowClosing"        
        WindowState="Maximized"
        FontFamily="Segoe UI">

    <Window.DataContext>
        <ViewModels:HomeScreenViewModel/>
    </Window.DataContext>

    <Grid x:Name="RootGrid">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>            
        </Grid.ColumnDefinitions>

        <!-- Main grid for bing map -->
        <Grid Grid.Row="0" Grid.RowSpan="3" Grid.ColumnSpan="2" x:Name="MapGrid" Margin="0 0 0 0">
            <m:Map x:Name="MainMap" CredentialsProvider="AkD8LxvWxAO3Qg-ULDBCYmx9wTbb4jGU71Xgyc28SQuMRT-NMQ-qyWKkEMtDesFe" Center="{Binding MapCenterPoint, Mode=TwoWay}" ZoomLevel="{Binding MapZoomLevel,Mode=TwoWay}" Mode="AerialWithLabels"/>
        </Grid>

        <!-- Title View -->
        <k:KinectSensorChooserUI HorizontalAlignment="Center" VerticalAlignment="Top" x:Name="sensorChooserUi" KinectSensorChooser="{Binding SensorChooser}"/>
        <DockPanel Grid.Row="0" Grid.ColumnSpan="2" Margin="10,0,10,20" >
            <TextBlock Text="Kinect Bing Map" Foreground="White" FontSize="30" DockPanel.Dock="Left" Margin="0 10 0 0 "/>            
        </DockPanel>
        
        <!-- Main Canvas to host kinect cursor-->        
        <Canvas Grid.Row="0" Grid.Column="0" Grid.RowSpan="3" Grid.ColumnSpan="2" x:Name="MainCanvas" Margin="20 0 10 0">
            <Ellipse Canvas.Left="{Binding LeftHandX}" Canvas.Top="{Binding LeftHandY}" Height="50" x:Name="leftHand"  Width="50" Fill="#FF4D298D" Opacity="1" Stroke="White" />
            <Ellipse Canvas.Left="{Binding RightHandX}" Canvas.Top="{Binding RightHandY}" Fill="#FF2CACE3" Height="50" x:Name="rightHand" Width="50" Opacity="1" Stroke="White" />
        </Canvas>
        
        <!-- side bar to display action buttons -->
        <!-- TODO -->
        
        <!-- Status bar to display test message and other depth viewer-->
        <StackPanel Grid.Row="2" Grid.Column="0" x:Name="LogMessage">
            <TextBlock x:Name="testMessageLeftHand" Width="1000" Height="100" FontSize="20" Foreground="White" HorizontalAlignment="Center" Text="{Binding TestMessageLeftHand}" />
            <TextBlock x:Name="testMessageRightHand" Width="1000" Height="100" FontSize="20" Foreground="White" HorizontalAlignment="Center" Text="{Binding TestMessageRightHand}"/>
        </StackPanel>
        <kt:KinectDepthViewer Grid.Row="2" Grid.Column="1" Margin="10" x:Name="KinectDepthViewer" Width="200" Height="150" KinectSensorManager="{Binding SensorManager}"/>

    </Grid>

</Window>
